<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="/WEB-INF/tld/waybillStatus.tld" prefix="ws" %>
<%@ taglib uri="/WEB-INF/tld/showUpsAndWeight.tld" prefix="uw" %>  
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>管理员管理运单</title>
		<link rel="stylesheet" type="text/css" href="btn_class.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/resources/css/ext-all.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/style.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/desktop.css" />
		<link rel="stylesheet" type="text/css"
			href="ext-2.2/ext-2.2/ext-patch.css" />

		<script type="text/javascript" src="ext-2.2/adapter/ext/ext-base.js"></script>
		<script type="text/javascript" src="ext-2.2/ext-all.js"></script>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

		<script type="text/javascript">
		<%String uId = (String) session.getAttribute("Uid");
			if (uId == null || uId.equals("null")) {%>
			window.parent.location.href = 'index.jsp';
		<%}%>
	</script>
	<style type="text/css">
		
		.btnSubmit
		{
			padding-bottom : 0px;
			margin : 0px;
			padding-left : 0px;
			padding-right : 0px;
			font-family : "宋体", Arial, Helvetica, sans-serif;
			font-size : 12px;
			padding-top : 0px;
			height : 18px;
		}
		.bd1
		{
			width : 200px;
			float : left;
			height : 20px;
		}
		div
		{
			padding-bottom : 0px;
			margin : 0px;
			padding-left : 0px;
			padding-right : 0px;
			font-family : "宋体", Arial, Helvetica, sans-serif;
			font-size : 12px;
			padding-top : 0px;
			
		}
		.right_center
		{
			background : white;
			padding-bottom: 50px;
			padding-left: 30px;
			width : 100%;
			padding-right: 0px;
			padding-top: 28px;
		}
		.wenzi
		{
			text-align : right;
			line-hight :20 px;
			width :102px;
			padding-right :10px;
			float : left;
			height :20 px;
		}
		.wenzi2
		{
			line-hight :20 px;
			width :300px;
			padding-left :40px;
			float : left;
			height :20 px;
		}
		
		.wwhh
		{
			padding-bottom : 10px;
			line-height : 14px;
			padding-left : 110px;
			width : 1000px;
			padding-right : 0px;
			color : #a9a9a9;
			padding-top : 0px;
		}
		
	</style>
	<script type="text/javascript">
	//js calculate
	//js浮点数精确计算函数(加，减，乘，除)

//浮点数加法运算 

function FloatAdd(arg1,arg2){ 

var r1,r2,m; 

try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 

try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 

m=Math.pow(10,Math.max(r1,r2)); 

return (arg1*m+arg2*m)/m; 

} ; 


//浮点数减法运算 

function FloatSub(arg1,arg2){ 

var r1,r2,m,n; 

try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 

try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 

m=Math.pow(10,Math.max(r1,r2)); 

//动态控制精度长度 

n=(r1>=r2)?r1:r2; 

return ((arg1*m-arg2*m)/m).toFixed(n); 

} ; 


//浮点数乘法运算 

function FloatMul(arg1,arg2) { 

var m=0,s1=arg1.toString(),s2=arg2.toString(); 

try{m+=s1.split(".")[1].length}catch(e){} 

try{m+=s2.split(".")[1].length}catch(e){} 

return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m) 

} ; 



//浮点数除法运算 

function FloatDiv(arg1,arg2){ 

var t1=0,t2=0,r1,r2; 

try{t1=arg1.toString().split(".")[1].length}catch(e){} 

try{t2=arg2.toString().split(".")[1].length}catch(e){} 

with(Math){ 

r1=Number(arg1.toString().replace(".","")) ; 

r2=Number(arg2.toString().replace(".","")); 

return (r1/r2)*pow(10,t2-t1); 

} 
};
	//calculate end
	
	
		function managerApprovalWaybill(wbId){
			var wbStatus = document.getElementById("wbStatus").value;
			if(wbStatus == ""){
				alert("请更改订单状态!");
				return;
			}
			var weight = document.getElementById("wbActualWeight").value;
				if(weight == "" )
				{
					alert("请输入重称重量!");
					return;
				}
			var wbBalanceDesc = document.getElementById("wbBalanceDesc").value;
			if(wbBalanceDesc == ""){
				alert("请输入运单费用!");
				return;
			}
			var wbTotalMoney = document.getElementById("wbTotalMoney").value;
			if(wbTotalMoney == ""){
				alert("请输入运单费用!");
				return;
			}
		
			var f = document.forms["wbApprovalForm"];
			var usedPoints = document.getElementById("usedPoints");
			if(usedPoints == undefined){
				f.action = "waybill!managerApprovalAWaybill.do?wbId="+wbId+"&flag=A";
				}else{
					f.action = "waybill!managerApprovalAWaybill.do?wbId="+wbId+"&flag=A&usedPoints="+document.getElementById("usedPoints").value;
				}
			f.submit(); 
		}
				
	</script>
	</head>


<body class="ext-ie ext-ie6 ext-border-box " id="ext-gen6">
<div class="x-panel x-panel-noborder x-form-label-right" id="ext-comp-1001" style="width: 100%;">
	<div class="x-panel-header x-panel-header-noborder x-unselectable" id="ext-gen8" style="mozuserselect: none; khtmluserselect: none;" unselectable="on">
		<span class="x-panel-header-text" id="ext-gen21">管理员管理运单</span>
	</div>
	 <form name="wbApprovalForm" method="post">
	 	<s:iterator id="wb" value="wbTO">
		<div class="right_center">
		<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >运单信息：</div>
		<br/>
		
			<div style="height:26px">
				<div class="wenzi">订单编号：</div>
				<input name="wbId" class="bd3" id="wbId" type="text" value="<s:property value="#wb.wbId"/>" />
			</div>
				<div style="height:26px">
				<div class="wenzi">当前订单状态：</div>
				<div class="wenzi2"><ws:translateStatus enStatus="${wb.wbStatus}"></ws:translateStatus></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">更改状态：</div>
				<select name="wbStatus"  class="bd1">
						<option value =""></option>
  						<option value ="unPayforStatus">待付款</option>
				</select>
				<font color="#ff0000">*</font>
			</div>
			<div style="height:26px">
				<div class="wenzi">提交日期：</div>
				<div class="wenzi2"><s:property value="#wb.wbSubmitTime"/></div>
			</div>
			<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >运费信息：</div>
			<br/>


			<div style="height:26px">
				<div class="wenzi">原始运单：</div>
				<div class="wenzi2"><uw:showUpsWeight upsWeightStr="${wb.wbAllUpsAndwWight}"></uw:showUpsWeight></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">重称重量：</div>
					<input name="wbActualWeight" id="wbActualWeight" onBlur="calculate()" class="bd1" type="text" size="18"/><font color="red">Lbs(*)</font>
			</div>
			<div style="height:26px">
				<div class="wenzi">运单类型：</div>
				<div class="wenzi2">
			 				<c:if   test= "${wb.wbOperateRequireType == '0' && wb.wbIsFastBox == null }"> 
									 原箱转发
							</c:if>
							<c:if   test= "${wb.wbOperateRequireType == '0' && wb.wbIsFastBox != null }"> 
									 极速原箱
							</c:if>
							<c:if   test= "${wb.wbOperateRequireType == '1'&&wb.wbTogetherSvc == '1'&& wb.wbSplitSvc == null}"> 
									合箱服务
							</c:if>
							<c:if   test= "${wb.wbOperateRequireType == '1'&&wb.wbTogetherSvc == null &&wb.wbSplitSvc == '1'}"> 
									分箱服务
							</c:if>
								<c:if   test= "${wb.wbOperateRequireType == '1'&&wb.wbTogetherSvc == '1'&&wb.wbSplitSvc == '1'}"> 
									混合服务
							</c:if>&nbsp;
				</div>
			</div>
			<div style="height:26px">
				<div class="wenzi">本次抵扣积分：</div>
					<input name="usedPoints" id="usedPoints" class="bd1" type="text" size="18" />
			</div>
			<div style="height:26px">
				<div class="wenzi">运单费用说明：</div>
				<textarea name="wbBalanceDesc" id="wbBalanceDesc" class="bd6" rows="3" cols="40"></textarea><font color="red">*</font>
			</div>
			<div style="height:26px">
				<div class="wenzi">总费用：</div>
					<input name="wbTotalMoney" id="wbTotalMoney" class="bd1" type="text" size="18"/><font color="red">RMB(*)</font>
			</div>
			<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >货物信息：</div>
			<br/>
			<div style="height:26px">
				<div class="wenzi">货物类别：</div>
				<div class="wenzi2">美-中线 (EMS)</div>
			</div>
			<div style="height:26px">
				<div class="wenzi">货物说明：</div>
				<div class="wenzi2"><s:property value="#wb.wbGoodsDesc"/></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">申报价值：</div>
				<div class="wenzi2"><s:property value="#wb.wbApplyValue"/></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">购买保险：</div>
				<div class="wenzi2" width="1000px">
					<c:if   test= "${wb.wbInsuranceFlag == 'Y'}"> 
							是
					</c:if>
					<c:if   test= "${wb.wbInsuranceFlag == 'N'}"> 
							否
					</c:if>
				</div>
			</div>
			<div style="height:26px">
				<div class="wenzi">积分代扣：</div>
				<div class="wenzi2" width="1000px">
					<c:if   test= "${wb.wbIsIntegral == 'Y'}"> 
							是
					</c:if>
					<c:if   test= "${wb.wbIsIntegral == 'N'}"> 
							否
					</c:if>
				</div>
			</div>
			<div style="height:26px">
				<div class="wenzi">包装要求：</div>
				<div class="wenzi2" style="width:600px">
					<c:if   test= "${wb.wbPackqcfp == '1'}"> 
							取出发票;
						</c:if>
						<c:if   test= "${wb.wbPackjjcl  == '1'}"> 
							加急处理;
						</c:if>
						<c:if   test= "${wb.wbPacknjjg  == '1'}"> 
							内固加件;
						</c:if>
						<c:if   test= "${wb.wbPackghwx  == '1'}"> 
							 更换外箱;
						</c:if>
						<c:if   test= "${wb.wbPackjtwx == '1'}"> 
							加套外箱;
						</c:if>
						<c:if   test= "${wb.wbPackqcnj == '1'}"> 
							去除内件;
						</c:if>
						<c:if   test= "${wb.wbPackyxzy == '1'}"> 
							原箱转发;
						</c:if>
						<c:if  test= "${wb.wbPackzdwpfx == '1'}"> 
							指定物品分箱;
						</c:if>
				</div>
			</div>
			<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >收货信息：</div>
			<br/>
			<div style="height:26px">
				<div class="wenzi">收货人：</div>
				<div class="wenzi2"><s:property value="#wb.wbPUname"/></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">收货人电话：</div>
				<div class="wenzi2"><s:property value="#wb.wbPUphone"/></div>
			</div>
			<div style="height:26px">
				<div class="wenzi">收货地址：</div>
				<div class="wenzi2"><s:property value="#wb.wbPUcity"/>&nbsp;&nbsp;<s:property value="#wb.wbPUaddress"/></div>
			</div>
			<div style="height:20px;align:center;  background: #eff5fb; color: #1e5494; font-size: 15px; font-weight: bold; border: #7db5de 1px solid;" >运单留言：</div>
			<br/>
			<div style="height:26px">
				<div class="wenzi"><font color="#0000ff">客户留言：</font></div>
				<div class="wenzi2"><s:property value="#wb.wbNote"/></div>
			</div>
			<div style="height:26px">
				<div class="wenzi"></div>
				<div class="wenzi2"><input type="button" value="提交" class="btnSubmit" onclick="managerApprovalWaybill('${wb.wbId}')" /></div>
			</div>
		</div>
		</s:iterator>
		
	</form>
</div>
</body>
</html>
